import ujson

def save_dict_to_file(data_dict):
    with open("config.json", 'w') as f:
        ujson.dump(data_dict, f)

def load_dict_from_file(filename):
    try:
        with open(filename, 'r') as f:
            return ujson.load(f)
    except:
        return {}  # 文件不存在时返回空字典

